package cmd

import (
	"fmt"
	"im-tools/internal/service"

	"github.com/spf13/cobra"
)

var userCmd = &cobra.Command{
	Use:   "userInfo",
	Short: "查询用户信息",
	Long:  `根据用户Id、手机号查询用户关联数据`,
	Run: func(cmd *cobra.Command, args []string) {
		userId, _ := cmd.Flags().GetString("id")
		if userId == "" {
			fmt.Println("输入ID")
			return
		}
		fmt.Println(userId)

		us := &service.UserService{}
		user := us.UserInfo(userId)
		fmt.Println("phone->", user.Phone)
	},
}

func init() {
	// userCmd.Flags().StringP("id", "i", "", "输入登录用户id")
	rootCmd.AddCommand(userCreateCmd)
}
